/**
 * 
 */
package loadtest;

import mockapp.SampleClientApp;
import mockapp.SampleServerApp;
import mockapp.SampleServerListener;

import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerClient;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;

import easyservice.application.ClientAgentImpl;

/**
 * @author Rodrigo
 * 
 */
public class LoadTest implements JavaSamplerClient {

	private SampleClientApp c1;
	private ClientAgentImpl<SampleServerApp, SampleServerListener> clientAgent1;
	private SampleServerApp proxyApp;

	public LoadTest() {
		clientAgent1 = new ClientAgentImpl<SampleServerApp, SampleServerListener>("client1", "client1", "zezinho", 5222, "server1@zezinho", SampleServerApp.class, c1);
		proxyApp = (SampleServerApp) clientAgent1.getFacade();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.jmeter.protocol.java.sampler.JavaSamplerClient#getDefaultParameters()
	 */
	@Override
	public Arguments getDefaultParameters() {
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.jmeter.protocol.java.sampler.JavaSamplerClient#runTest(org.apache.jmeter.protocol.java.sampler.JavaSamplerContext)
	 */
	@Override
	public SampleResult runTest(JavaSamplerContext context) {
		SampleResult result = new SampleResult();
		proxyApp.methodLoad();
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.jmeter.protocol.java.sampler.JavaSamplerClient#setupTest(org.apache.jmeter.protocol.java.sampler.JavaSamplerContext)
	 */
	@Override
	public void setupTest(JavaSamplerContext context) {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.jmeter.protocol.java.sampler.JavaSamplerClient#teardownTest(org.apache.jmeter.protocol.java.sampler.JavaSamplerContext)
	 */
	@Override
	public void teardownTest(JavaSamplerContext context) {
		proxyApp = null;
		clientAgent1 = null;
		c1 = null;
	}

}
